/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-05-21     chenhy       the first version
 */
#ifndef APPLICATIONS_UART_H_
#define APPLICATIONS_UART_H_
#include <stm32f0xx.h>
#define UART_CACHE_SIZE 1024
#undef USING_UART1
#define USING_UART2
#define USING_UART3
#define USING_SHELL
#ifdef USING_UART1
extern UART_HandleTypeDef huart1;
int uart1_init(void);
#endif
#ifdef USING_UART2
extern UART_HandleTypeDef huart2;
int uart2_init(void);
#endif
#ifdef USING_UART3
extern UART_HandleTypeDef huart3;
int uart3_init(void);
#endif
int uart_init(void);
int uart_deinit(void);
void uart_recv_callback(UART_HandleTypeDef *huart, unsigned char* pbuf, int size);
int uart_write(UART_HandleTypeDef *huart, void* pbuf, int size);
void print_buffer(unsigned char *data, int length);
#endif /* APPLICATIONS_UART_H_ */
